<%@ page language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>

<dwz:paginationForm action="${r"${contextPath}"}/${table.instanceName}/list" page="${r"${page}"}" onsubmit="return navTabSearch(this)">
</dwz:paginationForm>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="${table.entityName}:view">
			<li><a iconClass="application" mask="true" target="dialog" rel="lookup2${table.instanceName}_view" width="540" height="350"  href="${r"${contextPath}"}/${table.instanceName}/view/{slt_uid}"><span>查看${moduleName}</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="${table.entityName}:create">
			<li><a iconClass="application_add" mask="true" target="dialog" rel="lookup2${table.instanceName}_create" width="540" height="350"  href="${r"${contextPath}"}/${table.instanceName}/create"><span>添加${moduleName}</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="${table.entityName}:edit">
			<li><a iconClass="application_edit" target="dialog"  rel="lookup2${table.instanceName}_edit" width="540" height="350" mask="true" href="${r"${contextPath}"}/${table.instanceName}/edit/{slt_uid}"><span>编辑${moduleName}</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="${table.entityName}:delete">
			<li><a iconClass="application_delete" class="delete" target="selectedTodo" rel="${table.pk.fieldName}s"  title="确认要删除用户吗?"   href="${r"${contextPath}"}/${table.instanceName}/delete"><span>删除${moduleName}</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" layoutH="75" width="100%">
		<thead>
			<tr>
				<#list table.columns as column>
					<#if column.isKey>
						<th width="22"><input type="checkbox" group="${column.fieldName}s" class="checkboxCtrl"></th>
						<#if column.isAutoIncrement==false>
							<th>${column.comment}</th>
						</#if>
					<#else>
						<th>${column.comment}</th>
					</#if>	
				</#list>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${r"${"}${table.instanceName}List}">
			<tr target="slt_uid" rel="${r"${item."}${table.pk.fieldName}}">
				
				<#list table.columns as column>
					<#if column.isKey>
						<td><input name="${column.fieldName}s" value="${r"${item"}.${column.fieldName}}" type="checkbox"></td>
						<#if column.isAutoIncrement==false>
							<td>${r"${item."}${column.fieldName}}</td>
						</#if>
					<#else>
						<#if column.javaType == "Date">
						<td><fmt:formatDate value="${r"${item."}${column.fieldName}}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<#else>
						<td>${r"${item."}${column.fieldName}}</td>
						</#if>
					</#if>	
				</#list>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<!-- 分页 -->
	<dwz:pagination page="${r"${page}"}" />

	
</div>